package com.firebird.app.fekpsl.ui.activity.me

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.firebird.app.fekpsl.R
import com.firebird.app.fekpsl.base.BaseTbActivity
import com.firebird.app.fekpsl.ui.fragment.me.SimpleCardFragment
import com.firebird.app.fekpsl.utils.ViewFindUtils
import com.flyco.tablayout.SegmentTabLayout
import java.util.*

class StaIntegralFieldActivity : BaseTbActivity() {
    private val mFragments = ArrayList<Fragment>()
    private val mTitles = arrayOf("30天", "90天", "1年", "所有时间")
    private var mDecorView: View? = null
    private val mTabLayout: SegmentTabLayout? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.me_sta_integral_field)
        for (title in mTitles) {
            mFragments.add(SimpleCardFragment.getInstance(title))
        }
        mDecorView = window.decorView
        val tabLayout: SegmentTabLayout = ViewFindUtils.find(mDecorView, R.id.tl_days)
        tabLayout.setTabData(mTitles, this, R.id.fl_change, mFragments)
        initView()
    }

    private fun initView() {
        val r = this.resources
        val drawable = r.getDrawable(R.drawable.back)
        drawable.setBounds(0, 0, 120, 120)
        val view: View = LayoutInflater.from(this).inflate(R.layout.layout_toolbar, null)
        val tv_back = findViewById<View>(R.id.tv_back) as TextView
        tv_back.setCompoundDrawables(drawable, null, null, null)
        setBack()
        val titleName = r.getString(R.string.platform_integral_field)
        setTitle(titleName)
    }
}
